package com.hmsm.sys.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * UserInfo entity. @author MyEclipse Persistence Tools
 */

@SuppressWarnings("serial")
public class MenuDto<M extends MenuDto> implements Serializable {

	// Fields

	private Integer id;
	private M parent;
	private Integer orderNo;
	private String name;
	private String description;
	private String url;
	private String icon;
	private String backgroundImage;
	private String menuImage;
	private List<M> menus = new ArrayList<M>();
	private String purviewKey;
	
	private boolean showEnabled = true;
	
	public MenuDto(){
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public M getParent() {
		return parent;
	}
	public void setParent(M parent) {
		this.parent = parent;
	}
	public Integer getOrderNo() {
		return orderNo;
	}
	public void setOrderNo(Integer orderNo) {
		this.orderNo = orderNo;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getBackgroundImage() {
		return backgroundImage;
	}

	public void setBackgroundImage(String backgroundImage) {
		this.backgroundImage = backgroundImage;
	}

	public String getMenuImage() {
		return menuImage;
	}

	public void setMenuImage(String menuImage) {
		this.menuImage = menuImage;
	}

	public List<M> getMenus() {
		return menus;
	}
	public void setMenus(List<M> menus) {
		this.menus = menus;
	}

	public String getPurviewKey() {
		return purviewKey;
	}

	public void setPurviewKey(String purviewKey) {
		this.purviewKey = purviewKey;
	}

	public boolean isShowEnabled() {
		return showEnabled;
	}

	public void setShowEnabled(boolean showEnabled) {
		this.showEnabled = showEnabled;
	}
	
	public int getLevel(){
		int level = 1;
		
		if (parent!=null){
			level = parent.getLevel()+1;
		}
		
		return level;
	}

}